package org.ddd.book.domain.security.service;

import org.ddd.book.domain.security.vo.UserVO;

/**
 * 安全服务
 */
public interface ISecurityService {
    class CustomSecurityException extends RuntimeException {
        CustomSecurityException(String errorMsg) {
            super(errorMsg);
        }
    }

    /**
     * 判断是否已经登陆
     *
     * @throws CustomSecurityException 验证失败时异常
     */
    void checkLogin() throws CustomSecurityException;

    /**
     * 当前登陆的用户
     *
     * @return UserVO
     * 验证失败时抛出CustomSecurityException
     */
    UserVO currentUser();

}
